package org.yutian.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;

@Controller
@ResponseBody
@RequestMapping("/")
class HelloController {
   @GetMapping("/hello")  // @GetMapping
   public void home(HttpServletResponse response) {
      // throw new RuntimeException("test");
      // return "Hello World!";
      response.setStatus(302);
      response.setHeader("location", "https://app.mi.com");
   }

}